package com.example.mapper;

import com.example.domain.ResponseResult;
import com.example.domain.dto.ModInitUserDto;
import com.example.domain.entity.User;
import com.example.domain.vo.UserListVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
* @author TXX
* @description 针对表【user】的数据库操作Mapper
* @createDate 2023-02-04 21:35:15
* @Entity .domain.User
*/
@Repository
public interface UserMapper {

    int deleteByPrimaryKey(Long id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    List<UserListVo> getUserList(@Param("studentid") String studentid, @Param("name") String name,
                                 @Param("grade") String grade, @Param("college") Integer col,
                                 @Param("role") Integer rol, @Param("authority") Integer aut);

    User selectByStudentId(String studentid);

    int deleteUser(String id);

    ModInitUserDto selectModInitUserById(String userId);

    String selectUserNameById(String userId);

    int updateUserById(User user);

    int selectAuthorityIdByUserId(String userId);

    int updatePassword(@Param("id") String id,@Param("newPassword") String newPassword);

    String selectUserNameByStudentId(String studentid);

    List<String> selectPermsListByUserId(String id);

    void updateAuthorityByDeleteAuthorityId(Integer id);

    void updateRoleByDeleteRoleId(Integer id);

    void updateCollegeByDeleteCollegeId(Integer id);
}
